import http from './public'
import qs from 'qs'
let config = require('~/config/sysConfig')
let apiURL = config.apiURL;
let staticURL = config.staticURL;
if (typeof window === 'undefined') {
  apiURL = config.backApiURL;
  staticURL = config.backStaticURL
}

//搜索接口，支持分页，支持关键字、条件等搜索
export const search_course = (page,size,params) => {
  //let loginRequest = querystring.stringify(params)
  //将参数转换为k-v字符串
  let querys = qs.stringify(params);
  return http.requestQuickGet(apiURL+"/search/course/list/"+page+"/"+size+"?"+querys);
};

//获取本地json文件分类信息
export const sysres_category = () => {
  return http.requestQuickGet(staticURL+"/category/category.json");
};

